#define _CRT_SECURE_NO_WARNINGS 1
#include"string.h"
void test1()
{
	string s1;
	string s2("yang jun tao");
	cout << s2.c_str() << endl;
	for (int i = 0; i < s2.size(); i++)
	{
		cout << s2[i] << " ";
	}
	cout << endl;
	string::iterator it = s2.begin();
	while (it != s2.end())
	{
		cout << *it << " ";
		it++;
	}
	cout << endl;
	s2.push_back(' ');
	s2.push_back('h');
	s2.push_back('e');
	s2.push_back(' ');
	cout << s2.c_str() << endl;
	s2.append("wang ye hui");
	cout << s2.c_str() << endl;
	s2 += ' ';
	s2 += "kang gao jin";
	cout << s2.c_str() << endl;
}
void test2()
{
	string s1("yang jun hui");
	s1.insert(4, "xxxxxxxxx");
	cout << s1.c_str() << endl;
	s1.erase(4, 9);
	cout << s1.c_str() << endl;
	cout << s1.find(1) << endl;
}
void test3()
{
	string s1("https://gitee.com/bithange/110-issues/blob/master/23%E5%B9%B4-11%E6%9C%8823%E6%97%A5--string/string.h");
	cout << s1.substr(10) << endl;
}
void test4()
{
	string s1("hello pite");
	string s2(s1);
	cout << s2 << endl;
}
int main()
{
	//test1();
	//test2();
	//test3();
	test4();
	return 0;
}